package com.adopapa.nezhacloud.register.controller;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.adopapa.nezhacloud.common.RestResponse;
import com.adopapa.nezhacloud.ddd.controller.BaseController;

@RestControllerAdvice
@RequestMapping("/register/auth")
public class AuthController extends BaseController {

	@ExceptionHandler
	@RequestMapping(path = "/error", produces = MediaType.APPLICATION_JSON_VALUE)
	public RestResponse exception(Exception e) {
		logger.error(ExceptionUtils.getStackTrace(e));
		return RestResponse.error(e);
	}
	
	@RequestMapping(path = "/ok", produces = MediaType.APPLICATION_JSON_VALUE)
	public RestResponse ko() {
		return RestResponse.ok();
	}
	
	

}
